//
// taken from http://www.cryptopp.com/docs/ref/test_8cpp_source.html
// test.cpp - written and placed in the public domain by Wei Dai
// 



#include "components/encrypt/utils.hpp"

CryptoPP::SecByteBlock  HexDecodeString(const char *hex)
{
       CryptoPP::StringSource ss(hex, true, new CryptoPP::HexDecoder);
       CryptoPP::SecByteBlock result((size_t)ss.MaxRetrievable());
       ss.Get(result, result.size());
       return result;
}
CryptoPP::SecByteBlock  HexDecodeString(std::string const& hex)
{
    return HexDecodeString(hex.c_str());
}
CryptoPP::SecByteBlock  Base64DecodeString(const char *base64)
{
       CryptoPP::StringSource ss(base64, true, new CryptoPP::Base64Decoder);
       CryptoPP::SecByteBlock result((size_t)ss.MaxRetrievable());
       ss.Get(result, result.size());
       return result;
}
CryptoPP::SecByteBlock  Base64DecodeString(std::string const& base64)
{
    return Base64DecodeString(base64.c_str());
}
